<script setup>
	import { getAssetURL } from '@/utils/get-assets.js'
	import bannerData from '@/assets/data/banner.js'
</script>

<template>
	<div class="home-banner-vant">
		<van-swipe
			class="my-swipe"
			:autoplay="3000"
			indicator-color="white">
			<template
				v-for="(item, index) in bannerData"
				:key="index">
				<van-swipe-item>
					<a :href="item.url">
						<img
							class="img"
							:src="getAssetURL(item.image)"
							alt=""
							srcset="" />
					</a>
				</van-swipe-item>
			</template>
		</van-swipe>
	</div>
</template>

<style lang="scss" scoped>
	.home-banner-vant {
		.my-swipe .van-swipe-item {
			width: 100%;
			height: 170px;
			.img {
				height: 100%;
				width: 100%;
			}
		}
	}
</style>
